package com.cc.entity;

import java.text.SimpleDateFormat;
import java.util.Date;
import lombok.Data;

/**
 * @TableName book
 */
@Data
public class Book {
    private Integer id;

    private String bookName;

    private String author;

    private Date publicationdate;

    private Integer price;

    private Integer categoryId;

//格式化输出
    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return "Book(id=" + id +
                ", bookName=" + bookName +
                ", author=" + author +
                ", publicationdate=" + sdf.format(publicationdate) +
                ", price=" + price +
                ", categoryId=" + categoryId + ")";
    }
}